package cn.android666.recorddemowithnoise

import android.Manifest
import androidx.fragment.app.FragmentActivity

object PermissionUtil {

    fun registerForActivityResult(activity: FragmentActivity) {
        NormalPermissionUtil.setRequestPermissions(mapOf(Manifest.permission.RECORD_AUDIO to "录音"))
        NormalPermissionUtil.registerForActivityResult(activity)
        StoragePermissionUtil.registerForActivityResult(activity)
    }

    fun requestPermission(activity: FragmentActivity, resultCallback: () -> Unit) {
        NormalPermissionUtil.requestPermissions(activity) {
            StoragePermissionUtil.requestPermission(activity, resultCallback)
        }
    }
}